<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('评价详情')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
    <style type="text/css">
        .bgtd{
            text-align: right;
            background-color: #d9edf7;
        }
    </style>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-taskDetail-edit" th:object="${evaTaskDetail}">
            <input name="taskDetailId" th:field="*{taskDetailId}" type="hidden">
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">参评部门id：</label>
                <div class="col-sm-8">
                    <input name="deptId" th:field="*{deptId}" class="form-control" type="text" required>
                </div>
            </div>-->
            <div class="row">
                <div class="col-sm-12">
                    <table id="table" class="table table-bordered" style="color:#000;table-layout:fixed;">
                        <tbody>
                        <tr>
                            <td width="30%" class="bgtd">年份：</td>
                            <td >[[${evaTaskDetail.year}]]</td>
                        </tr>
                        <tr>
                            <td width="30%" class="bgtd">评价名称：</td>
                            <td><span>[[${evaTaskDetail.taskName}]]</span></td>
                        </tr>

                        <tr>
                            <td width="30%" class="bgtd">合同名称：</td>
                            <td style="word-wrap:break-word;">[[${evaTaskDetail.contractName}]]</td>
                        </tr>
                        <tr>
                            <td width="30%" class="bgtd">合同收支类型：</td>
                            <td>
                                <select name="contractClass" class="form-control m-b" th:with="type=${@dict.getType('contract_class')}" disabled="disabled">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{contractClass}"></option>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td width="30%" class="bgtd">合同类型：</td>
                            <td >
                                <select name="contractType" class="form-control m-b" th:with="type=${@dict.getType('contract_type')}" disabled="disabled">
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{contractType}"></option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="30%" class="bgtd">合约方名称：</td>
                            <td><span>[[${evaTaskDetail.targetName}]]</span></td>
                        </tr>

                        <tr>
                            <td width="30%" class="bgtd">评分：</td>
                            <td >[[${evaTaskDetail.score}]]</td>
                        </tr>
                        <tr>
                            <td width="30%" class="bgtd">附件信息：</td>
                            <td align="right">
                                <span id="filePath">[[${evaTaskDetail.filePath}]]</span>
                                <span th:align="right"><i class="fa fa-download" style="color: #67b168" onclick="downloadFile()">下载</i></span>
                            </td>
                        </tr>

                        </tbody>
                    </table>
                </div>
            </div>

            <!--<div class="form-group">
                <label class="col-sm-3 control-label">年份：</label>
                <div class="col-sm-8">
                    <input name="year" th:field="*{year}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">任务名称：</label>
                <div class="col-sm-8">
                    <input name="taskName" th:field="*{taskName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">合同名称：</label>
                <div class="col-sm-8">
                    <input name="contractName" th:field="*{contractName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">合同收支类型：</label>
                <div class="col-sm-8">
                    <select name="contractClass" class="form-control m-b" th:with="type=${@dict.getType('contract_class')}" disabled="disabled">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{contractClass}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">合同类型：</label>
                <div class="col-sm-8">
                    <select name="contractType" class="form-control m-b" th:with="type=${@dict.getType('contract_type')}" disabled="disabled">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{contractType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">合约方名称：</label>
                <div class="col-sm-8">
                    <input name="targetName" th:field="*{targetName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">评分：</label>
                <div class="col-sm-8">
                    <input name="score" th:field="*{score}" class="form-control" type="number" min="0" max="100">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">附件信息：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="filePath" name="filePath" th:field="*{filePath}" class="form-control" type="text" readonly>
                        <span class="input-group-addon"><i class="fa fa-download" style="color: #67b168" onclick="downloadFile()">下载</i></span>
                    </div>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "credit/taskDetail";
        $("#form-taskDetail-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-taskDetail-edit').serialize());
            }
        }

        // 下载附件
        function downloadFile(){
            var filePath = $("#filePath").val();
            if(filePath == '' || filePath == null || filePath == undefined){
                $.modal.msgError('没有附件！');
            } else {
                window.location.href = ctx + "common/download/resource?resource=" + filePath;
            }
        }
    </script>
</body>
</html>
